package com.hiv.controller.wechat;

import com.hiv.common.BaseController;
import com.hiv.common.PageInfo;
import com.hiv.common.WebResponse;
import com.hiv.common.param.page.PageQueryHospitalParam;
import com.hiv.mapper.domain.Admin;
import com.hiv.mapper.domain.Hospital;
import com.hiv.service.HospitalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author zhanghong
 * @version XcxHospitalController.java, v 0.1 2022-09-18 XcxHospitalController Exp $$
 */
@RestController
@RequestMapping("/wechat/hospital")
@Api(value = "检验所模块", tags = {"【小程序端】质控中心/医院/检验所模块"})
public class XcxHospitalController extends BaseController {
    @Autowired
    private HospitalService hospitalService;

    @ApiOperation(value = "列表", httpMethod = "POST")
    @ApiResponses(value = {@ApiResponse(code = 200, message = "success")})
    @PostMapping("/list")
    public WebResponse<List<Hospital>> list(HttpServletRequest request, @RequestBody Hospital param) {
        validUserLoginAndGet(request, Admin.class);
        return WebResponse.build(hospitalService.selectList(param));
    }

}
